home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- Caption = "See Sub Readme ()"
- ClientHeight = 3000
- ClientLeft = 1275
- ClientTop = 1575
- ClientWidth = 2985
- Height = 3405
- Left = 1215
- LinkTopic = "Form1"
- ScaleHeight = 3000
- ScaleWidth = 2985
- Top = 1230
- Width = 3105
- Begin Data Data1
- Caption = "Data1"
- Connect = ""
- DatabaseName = ""
- Exclusive = 0 'False
- Height = 270
- Left = 1620
- Options = 0
- ReadOnly = 0 'False
- RecordSource = ""
- Top = 2160
- Width = 1155
- End
- Begin PictureBox Picture2
- Height = 315
- Left = 1560
- ScaleHeight = 285
- ScaleWidth = 1185
- TabIndex = 6
- Top = 840
- Width = 1215
- End
- Begin OptionButton Option1
- Caption = "Option1"
- Height = 255
- Left = 1560
- TabIndex = 5
- Top = 240
- Width = 1215
- End
- Begin CheckBox Check1
- Caption = "Check1"
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 2160
- Width = 1155
- End
- Begin TextBox Text1
- Height = 285
- Left = 120
- TabIndex = 3
- Text = "Text1"
- Top = 240
- Width = 1215
- End
- Begin PictureBox Picture1
- Align = 2 'Align Bottom
- BackColor = &H00C0C0C0&
- Height = 315
- Left = 0
- ScaleHeight = 285
- ScaleWidth = 2955
- TabIndex = 2
- Top = 2685
- Width = 2985
- End
- Begin CommandButton Command1
- Caption = "Command1"
- Height = 375
- Left = 120
- TabIndex = 0
- Top = 1500
- Width = 1215
- End
- Begin Image Image1
- BorderStyle = 1 'Fixed Single
- Height = 315
- Left = 1560
- Top = 1560
- Width = 1215
- End
- Begin Label Label1
- Caption = "Label1"
- Height = 195
- Left = 120
- TabIndex = 1
- Top = 900
- Width = 1215
- End
- Dim Printed As Integer ' Declare variable (duhh...)
- Sub Check1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Not Printed Then
- Picture1.Print "This is a Check Box"
- Printed = True
- End If
- ' This only executes if the tooltips bar is empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
- Sub Command1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Not Printed Then
- Picture1.Print "This is a Command Button"
- Printed = True
- End If
- ' This only executes if the tooltips bar is empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
- Sub Data1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Not Printed Then
- Picture1.Print "This is a Data Control"
- Printed = True
- End If
- ' This only executes if the tooltips bar is empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
- Sub Form_Load ()
- Move (Screen.Width / 2 - Width / 2), (Screen.Height / 2 - Height / 2)
- Printed = False 'Let everybody know the tooltips bar is empty.
- End Sub
- Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Printed Then
- Picture1.Cls
- Printed = False
- End If
- ' This only executes if the tooltips bar is NOT empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
- Sub Image1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Not Printed Then
- Picture1.Print "This is an Image Control"
- Printed = True
- End If
- ' This only executes if the tooltips bar is empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
- Sub Label1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Not Printed Then
- Picture1.Print "This is a Label Control"
- Printed = True
- End If
- ' This only executes if the tooltips bar is empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
- Sub Option1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Not Printed Then
- Picture1.Print "This is an Option Button"
- Printed = True
- End If
- ' This only executes if the tooltips bar is empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
- Sub Picture1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Not Printed Then
- Picture1.Print "This is the ToolTips Bar"
- Printed = True
- End If
- ' This only executes if the tooltips bar is empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
- Sub Picture2_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Not Printed Then
- Picture1.Print "This is a Picture Control"
- Printed = True
- End If
- ' This only executes if the tooltips bar is empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
- Sub Readme ()
- ' I'd been looking at various ways of implementing a
- ' "tooltips bar" (I think that's it's name), including
- ' some VBX's, DLL's, API calls, something that had a
- ' timer control in there somewhere, and a few other things.
- ' It all seemed pretty messy, so I started playing around.
- ' My first attempt at this yielded a tooltips bar, but the
- ' thing flickered on my 386 machine running plain VGA. I
- ' started looking at SendMessage when it occurred to me
- ' that all I needed to do was use "bad form" again. I say
- ' bad form because in the MDI app I was coding at the time,
- ' the variable "Printed" had to be Global, because the
- ' tooltips bar is on the MDI parent. And we all know that
- ' Globals and GoTos are bad form. (Could someone please
- ' explain that to me, again. I'm a fairly rank amateur.)
- ' Anyway, what's happening here is that in the declarations
- ' section, an integer variable is declared (in this case
- ' it's called "Printed"). Form_Load sets it to False.
- ' In the form's MouseMove event, the code clears the
- ' tooltips bar (a picture box with the align property set
- ' to 2-Bottom) and sets the variable to False.
- ' Then, in each of the control's MouseMove events, code is
- ' written to print a message in the tooltips bar, but ONLY
- ' if the control's code hasn't done so already (If NOT
- ' Printed Then...) since the third line in the If
- ' statement sets "Printed" to True. That prevents the code
- ' in the MouseMove event from executing with each one pixel
- ' shift in mouse cursor position (making it flicker, which
- ' by the way, doesn't show up much on my local bus
- ' screamer. I don't know how people can develope for
- ' Windows(tm) with only one machine. But I digress, again.)
- ' The same thing happens in the form's MouseMove event, but
- ' in reverse. The Form_MouseMove event clears the picture
- ' box, but only if it hasn't done so already (IF Printed
- ' Then blah blah, Printed = False). You'll have to make
- ' there is a little space between controls to make this
- ' code run. If you are using a toolbar that has buttons
- ' right up against each other, you could use a number
- ' rather than true..false to ensure that the code in the
- ' MouseMove event runs only one time, and that code
- ' will have to include the Picture1.Cls method.
- ' This code can be fooled by really quick mouse movement
- ' though. If your a stickler for such things, you ought
- ' to stay with GetCursorPos().
- ' If you find this code useful and decide to include it
- ' in one of your apps, you owe me 90 buzillion US bucks.
- ' In leu of that, I will accept a date with Samatha Fox.
- ' (You buy). In leu of that, just mention me in your app's
- ' help file or other documentation, if you want to.
- ' Or offer me a job (no joke). I can enforce this,
- ' by the way, since I have just perfected a disassembler
- ' that generates VB source code with comments intact.
- ' If any of the above doesn't make sense to you, or
- ' just want to chat, drop me a line at 72123,1243 (CIS),
- ' or on AOL to AaronCr.
- ' This part is not a joke: Use this code at your own risk.
- ' I accept no responsibilty for anything that happens
- ' when you use or run this sample code. I have no
- ' knowledge of any previous existance of any of this code
- ' It is, to my knowledge, purely the result of my own
- ' efforts.
- ' Enjoy!
- ' Aaron P. Crouse
- 'P.S. Look for me in this month's ZShare (#13) gloat, gloat.....
- ' Some of the things mentioned in here may be someone's
- ' copyright or trademark. If so, I appologize for any
- ' inadvertant credit omissions.
- End Sub
- Sub Text1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Not Printed Then
- Picture1.Print "This is an Edit Control"
- Printed = True
- End If
- ' This only executes if the tooltips bar is empty.
- ' And since it sets the it's own conditional variable,
- ' it only executes one time.
- End Sub
-